﻿namespace WMS6.Web.Inbound
{
    using System;
    using System.Web.UI.HtmlControls;
    using System.Web.UI.WebControls;
    using WMS6.Web;
    using WMS6.Web.UserControls;

    public class ReceiptInquiryQuery : BasePage
    {
        protected Button btnExport;
        protected Button btnList;
        protected Button btnNew;
        protected Button btnSearch;
        protected DropDownList ddlExpectedReceiptDate;
        protected DropDownList ddlExternalLot;
        protected DropDownList ddlExternReceiptID;
        protected DropDownList ddlIsActive;
        protected DropDownList ddlIsActiveOper;
        protected DropDownList ddlOwnerID;
        protected DropDownList ddlPoID;
        protected DropDownList ddlReceiptDate;
        protected DropDownList ddlReceiptID;
        protected DropDownList ddlReceiptTypeOper;
        protected DropDownList ddlSku;
        protected DropDownList ddlSkuClassID;
        protected DropDownList ddlVendorID;
        protected HtmlForm F4040;
        protected HtmlInputHidden hdnActionID;
        protected HtmlInputHidden hdncalendarFlag;
        protected HtmlInputHidden hdnDataFormat;
        protected HtmlImage img2;
        protected HtmlImage img3;
        protected Label lblExpectedReceiptDate;
        protected Label lblExternalLot;
        protected Label lblExternReceiptID;
        protected Label lblIsActive;
        protected Label lblOwnerID;
        protected Label lblPoID;
        protected Label lblReceiptDate;
        protected Label lblReceiptID;
        protected Label lblReceiptQuery;
        protected Label lblReceiptType;
        protected Label lblSku;
        protected Label lblSkuClassID;
        protected Label lblVendorID;
        protected MultipleSelectControl MSCReceiptType;
        protected HtmlLink mycss;
        protected TextBox txtExpectedReceiptDate;
        protected TextBox txtExpectedReceiptDate2;
        protected TextBox txtExternalLot;
        protected TextBox txtExternReceiptID;
        protected TextBox txtOwnerID;
        protected TextBox txtPoID;
        protected TextBox txtReceiptDate;
        protected TextBox txtReceiptDate2;
        protected TextBox txtReceiptID;
        protected TextBox txtSku;
        protected TextBox txtSkuClassID;
        protected TextBox txtVendorID;

        protected void btnSearch_Click(object sender, EventArgs e)
        {
            base.Server.Transfer("ReceiptInquiryList.aspx", false);
        }

        private void LoadDDl()
        {
            base.BindData2DDLBySysCode(this.MSCReceiptType, "ReceiptType");
            base.InitQueryDDL(this.ddlReceiptID, 0);
            base.InitQueryDDL(this.ddlPoID, 0);
            base.InitQueryDDL(this.ddlExternReceiptID, 0);
            base.InitQueryDDL(this.ddlOwnerID, 0);
            base.InitQueryDDL(this.ddlReceiptTypeOper, 0);
            this.ddlReceiptTypeOper.SelectedValue = "One Of";
            base.InitQueryDDL(this.ddlSku, 0);
            base.InitQueryDDL(this.ddlExpectedReceiptDate, 1);
            base.InitIsActiveDDL(this.ddlIsActive, 0);
            base.InitQueryDDL(this.ddlExternalLot, 0);
            base.InitQueryDDL(this.ddlReceiptDate, 1);
            base.InitQueryDDL(this.ddlVendorID, 0);
            base.InitQueryDDL(this.ddlSkuClassID, 0);
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!base.IsPostBack)
            {
                base.InitPage(this.Page);
                this.LoadDDl();
            }
        }

        public string ExpectedReceiptData
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtExpectedReceiptDate.Text.Trim()))
                {
                    return base.GetParamsString(this.txtExpectedReceiptDate.Text.Trim(), this.ddlExpectedReceiptDate.SelectedValue, this.txtExpectedReceiptDate2.Text.Trim(), "ExpectedReceiptData");
                }
                return "";
            }
        }

        public string ExternalLot
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtExternalLot.Text.Trim()))
                {
                    return base.GetParamsString(this.txtExternalLot.Text.Trim(), this.ddlExternalLot.SelectedValue);
                }
                return "";
            }
        }

        public string ExternReceiptID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtExternReceiptID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtExternReceiptID.Text.Trim(), this.ddlExternReceiptID.SelectedValue);
                }
                return "";
            }
        }

        public string IsActive
        {
            get
            {
                if (!string.IsNullOrEmpty(this.ddlIsActive.SelectedValue))
                {
                    return base.GetParamsString(this.ddlIsActive.SelectedValue, this.ddlIsActiveOper.SelectedValue);
                }
                return "";
            }
        }

        public string OwnerID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtOwnerID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtOwnerID.Text.Trim(), this.ddlOwnerID.SelectedValue);
                }
                return "";
            }
        }

        public string PoID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtPoID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtPoID.Text.Trim(), this.ddlPoID.SelectedValue);
                }
                return "";
            }
        }

        public string ReceiptDate
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtReceiptDate.Text.Trim()))
                {
                    return base.GetParamsString(this.txtReceiptDate.Text.Trim(), this.ddlReceiptDate.SelectedValue, this.txtReceiptDate2.Text.Trim(), "ReceiptDate");
                }
                return "";
            }
        }

        public string ReceiptID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtReceiptID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtReceiptID.Text.Trim(), this.ddlReceiptID.SelectedValue);
                }
                return "";
            }
        }

        public string ReceiptType
        {
            get
            {
                if (!string.IsNullOrEmpty(this.MSCReceiptType.ReturnValue))
                {
                    return base.GetParamsString(this.MSCReceiptType.ReturnValue, this.ddlReceiptTypeOper.SelectedValue);
                }
                return "";
            }
        }

        public string Sku
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtSku.Text.Trim()))
                {
                    return base.GetParamsString(this.txtSku.Text.Trim(), this.ddlSku.SelectedValue);
                }
                return "";
            }
        }

        public string SkuClassID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtSkuClassID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtSkuClassID.Text.Trim(), this.ddlSkuClassID.SelectedValue);
                }
                return "";
            }
        }

        public string VendorID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtVendorID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtVendorID.Text.Trim(), this.ddlVendorID.SelectedValue);
                }
                return "";
            }
        }
    }
}

